<template>
	<div>
		<el-drawer title="" :visible.sync="drawer" :direction="direction" :before-close="handleClose" custom-class="drawer-info">
			<div class="info-item">
				<h5 class="from-title">基本信息</h5>
				<div class="form-item">
					<label class="form-item-label">SEO标题:</label>
					<div class="form-item-content">{{ objInfo.title }}</div>
				</div>
				<div class="form-item">
					<label class="form-item-label">SEO描述:</label>
					<div class="form-item-content">{{ objInfo.info }}</div>
				</div>
				<div class="form-item">
					<label class="form-item-label">SEO关键字:</label>
					<div class="form-item-content">{{ objInfo.keywords }}</div>
				</div>
				<div class="form-item">
					<label class="form-item-label">名称:</label>
					<div class="form-item-content">{{ objInfo.name }}</div>
				</div>
				<div class="form-item">
					<label class="form-item-label">标识:</label>
					<div class="form-item-content">{{ objInfo.code }}</div>
				</div>
				<div class="form-item">
					<label class="form-item-label">访问地址:</label>
					<div class="form-item-content">
						{{ objInfo.url }}
						<fortress-copy :copyData="objInfo.url"></fortress-copy>
					</div>
				</div>
				<div class="form-item">
					<label class="form-item-label">专题图片:</label>
					<div class="form-item-content">
						<img v-if="objInfo.image" :src="objInfo.image" style="width: 100px; height: 100px" />
					</div>
				</div>
				<div class="form-item">
					<label class="form-item-label">专题内容:</label>
					<div class="form-item-content" v-html="objInfo.content"></div>
				</div>
				<div class="form-item">
					<label class="form-item-label">排序:</label>
					<div class="form-item-content">{{ objInfo.sort }}</div>
				</div>
				<div class="form-item">
					<label class="form-item-label">模板:</label>
					<div class="form-item-content">{{ objInfo.listtp }}</div>
				</div>
				<div class="form-item">
					<label class="form-item-label">是否显示:</label>
					<div class="form-item-content" v-if="objInfo.showflag == 1">显示</div>
					<div class="form-item-content" v-else>隐藏</div>
				</div>
			</div>
		</el-drawer>
	</div>
</template>
<script>
import { cmssubjectInfo } from "@/api/cms/cmssubject.js"

export default {
	data() {
		return {
			drawer: true,
			direction: "rtl",
			objInfo: {},
		}
	},
	created() {},
	methods: {
		init(id) {
			if (id) {
				cmssubjectInfo(id).then(res => {
					this.objInfo = res.data
				})
			}
			this.drawer = true
		},
		// 关闭抽屉
		handleClose(done) {
			done()
		},
	},
}
</script>
<style scoped>
.from-title {
	margin-bottom: 20px;
	padding: 0 20px 20px 20px;
	font-size: 16px;
	color: #17233d;
	border-bottom: 1px solid #eee;
}
.info-item {
	margin-bottom: 40px;
}

.form-item {
	margin-bottom: 20px;
	font-size: 14px;
}
.form-item-label {
	text-align: right;
	float: left;
	width: 25%;
}
.form-item-content {
	margin-left: 30%;
	width: 70%;
}
</style>
